package com.aglow.bluetoothspeaker.app;

import android.Manifest;
import android.app.Application;
import android.os.Build;
import android.support.annotation.NonNull;


import com.blankj.utilcode.util.PermissionUtils;
import com.blankj.utilcode.util.Utils;
import com.facebook.stetho.Stetho;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.BuildConfig;
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;






public class App extends Application{
    private static App instance;
    @Override
    public void onCreate() {
        super.onCreate();

        instance = this;

        FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
                .tag("SmartADH5_LOG")
                //方法数只打印 1 行
                .methodCount(1)
                .build();

        //设置 Logger 是否打印日志
        Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy) {
            @Override
            public boolean isLoggable(int priority, String tag) {
                return BuildConfig.DEBUG;
            }
        });

        //AndroidUtilCode 初始化
        Utils.init(this);
        //Facebook Stetho
        Stetho.initializeWithDefaults(this);
        //内存泄露检测工具
//        LeakCanary.install(this);

    }

    public static App getContext() {
        return instance;
    }



}
